package com.gaswell.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

public class HttpContextUtils {
    public static HttpServletRequest getHttpServletRequest(){
        return ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
    }

    public static String getHeadersValue(String key){
        HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
        String value = request.getHeader(key);
        return value;
    }


}
